import { createApp } from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//导入国际化
import zhCn from 'element-plus/es/locale/lang/zh-cn'
//您需要从 @element-plus/icons-vue 中导入所有图标并进行全局注册。
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

//导入一些函数，将来项目中可能会用上
import {
    getCurDate,
    setSessionStorage,
    getSessionStorage,
    removeSessionStorage,
    setLocalStorage,
    getLocalStorage,
    removeLocalStorage
} from './util/common'
import axios from "axios";

axios.defaults.baseURL='http://localhost:8091'

//axios.defaults.baseURL='http://localhost:8092'
//vue3创建应用实例
const app = createApp(App)
//全局使用axios
app.config.globalProperties.$axios=axios
//国际化
app.use(ElementPlus,{ locale: zhCn})
//用全局引入elementui插件

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.use(router)
app.mount('#app')

//createApp(App).use(router).mount('#app')
